//
//  Sensor.h
//  NXTRemoteController
//
//  Created by naceka on 24.03.12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

enum Sensor_Type {
	NO_SENSOR = 0x00,
	SWITCH = 0x01,
	TEMPERATURE = 0x02,
	REFLECTION = 0x03,
	ANGLE = 0x04,
	LIGHT_ACTIVE = 0x05,
	LIGHT_INACTIVE = 0x06,
	SOUND_DB = 0x07,
	SOUND_DBA = 0x08,
	CUSTOM = 0x09,
	LOWSPEED = 0x0A,
	LOWSPEED_9V = 0x0B,
	NO_OF_SENSOR_TYPES = 0x0C
};

enum Sensor_Mode {
	RAWMODE = 0x00,
	BOOLEANMODE = 0x20,
	TRANSITIONCNTMODE = 0x40,
	PERIODCOUNTERMODE = 0x60,
	PCTFULLSCALEMODE = 0x80,
	CELSIUSMODE = 0xA0,
	FARENHEITMODE = 0xC0,
	ANGELSATEPSMODE = 0xE0,
	SLOPEMASK = 0x1F,
	MODEMASK = 0xE0	
};


@interface Sensor : NSObject {
	
	//type
	enum Sensor_Type type;
	//mode
	enum Sensor_Mode mode;
	//current data
	uint8_t data[2];
}

- (Sensor *) initWithType:(enum Sensor_Type) t andMode:(enum Sensor_Mode) m;
- (enum Sensor_Type) getType;
- (NSString *) getTypeString;
- (enum Sensor_Mode) getMode;
- (void) setData:(uint8_t) d1 :(uint8_t) d2;
- (NSString *) getData;

@end
